# -*- coding:utf-8 -*-
# created by jinss

f = open("stock_data_v2", mode="r", encoding="utf-8")
stocks = []

for line in f:
    # print(line)
    stock = line.strip().split(",")
    # print(stock)
    stocks.append(stock)
# print(stocks)

while True:
    query = input("股票查询接⼝>>:").strip()
    query_result = []
    if query.find("当前价") >= 0:
        query_result.append(stocks[0])
        if query.find(">") >= 0:
            price = float(query.split(">")[1])
            for i,ele in enumerate(stocks):
                if i != 0 and float(ele[2]) > price:
                    query_result.append(ele)
        elif query.find("<") >= 0:
            price = float(query.split("<")[1])
            for i in stocks:
                if i != 0 and float(ele[2]) < price:
                    query_result.append(ele)
    elif query.find("涨跌幅") >= 0:
        query_result.append(stocks[0])
        if query.find(">") >= 0:
            rate = float(query.split(">")[1])
            for i,ele in enumerate(stocks):
                if i != 0 and float(ele[4].split("%")[0]) > rate:
                    query_result.append(ele)
        elif query.find("<") >= 0:
            rate = float(query.split("<")[1])
            for i,ele in enumerate(stocks):
                if i != 0 and float(ele[4].split("%")[0]) < rate:
                    query_result.append(ele)
    elif query.find("换手率") >= 0:
        query_result.append(stocks[0])
        if query.find(">") >= 0:
            rate = float(query.split(">")[1])
            for i,ele in enumerate(stocks):
                if i != 0 and float(ele[8].split("%")[0]) > rate:
                    query_result.append(ele)
        elif query.find("<") >= 0:
            rate = float(query.split("<")[1])
            for i,ele in enumerate(stocks):
                if i != 0 and float(ele[8].split("%")[0]) < rate:
                    query_result.append(ele)
    else:
        for i in stocks:
            if i[1].find(query) >= 0:
                query_result.append(i)

    print(query_result)